using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("TournamentGroupTournaments")]
	[Serializable]
    public class TournamentGroupTournament : DBO<TournamentGroupTournament>
    {
		#region Fields
		
		private int? _Id;
		private int? _IdGroupTournament;
		private int? _IdTournament;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public TournamentGroupTournament()
		{
			
		}
		
		/// <summary>
		/// Constructor with Id 
		/// </summary>
		/// <param name="Id">The Id</param>
		public TournamentGroupTournament(int? Id )
		{
			this.Id = Id;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="Id">Sets int? value for Id</param>
		/// <param name="IdGroupTournament">Sets int? value for IdGroupTournament</param>
		/// <param name="IdTournament">Sets int? value for IdTournament</param>
		public TournamentGroupTournament(int? id, int? idGroupTournament, int? idTournament)
		{
			this.Id = id;
			this.IdGroupTournament = idGroupTournament;
			this.IdTournament = idTournament;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for Id
		/// </summary>
		[ColumnAttribute("Id", SqlDbType.Int , 4 , true, true, false)]
		public int? Id
		{
			set
			{
				this._Id = value;
			}
			get
			{
				return this._Id;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdGroupTournament
		/// </summary>
		[ColumnAttribute("IdGroupTournament", SqlDbType.Int , 4 , false, false, true)]
		public int? IdGroupTournament
		{
			set
			{
				this._IdGroupTournament = value;
			}
			get
			{
				return this._IdGroupTournament;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdTournament
		/// </summary>
		[ColumnAttribute("IdTournament", SqlDbType.Int , 4 , false, false, true)]
		public int? IdTournament
		{
			set
			{
				this._IdTournament = value;
			}
			get
			{
				return this._IdTournament;
			}
		}
		
		
		/// <summary>
		/// Get a GroupTournament of current TournamentGroupTournament object base on IdGroupTournament
		/// </summary>
		public GroupTournament GroupTournament
		{
			get
			{
				if (this.IdGroupTournament == null)
					return null;
	
				GroupTournament condition = new GroupTournament(this.IdGroupTournament);
				return GroupTournamentController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Tournament of current TournamentGroupTournament object base on IdTournament
		/// </summary>
		public Tournament Tournament
		{
			get
			{
				if (this.IdTournament == null)
					return null;
	
				Tournament condition = new Tournament(this.IdTournament);
				return TournamentController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [Id]
            /// </summary>
            public string Id
            {
                get
                {
                    return "Id";
                }
            }
            /// <summary>
            /// Get the name of column [IdGroupTournament]
            /// </summary>
            public string IdGroupTournament
            {
                get
                {
                    return "IdGroupTournament";
                }
            }
            /// <summary>
            /// Get the name of column [IdTournament]
            /// </summary>
            public string IdTournament
            {
                get
                {
                    return "IdTournament";
                }
            }
        }
        #endregion
    }
}
